package com.wisely.ch9_3_4.provider;

import javax.jms.Destination;

import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

@Component
public class PubSubProvider {
	@Autowired
	private JmsMessagingTemplate jmsMessagingTemplate;

	public void sendPubSubMessage(String mesage, String desName) {
		Destination des = new ActiveMQTopic(desName);
		jmsMessagingTemplate.convertAndSend(des, mesage);
	}
}
